/**
SimpleWorkflowEntry.java
osworkflowEx
2012-7-26下午5:37:52
@author 屈甲康
@QQ285799123
mailto:qujiakang@126.com
**/
package org.jackysoft.entity;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import org.bson.types.ObjectId;
import org.jackysoft.annotations.BID;

import com.mongodb.DBObject;


@MappedSuperclass
public class AbstractWorkflowEntry implements WorkflowEntry {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5027021798603447054L;

	protected String workflowName;
	protected Integer state = 0;
	protected Long id = -1L;	
	
	public AbstractWorkflowEntry() {
		super();
	}

	public AbstractWorkflowEntry(String name){
		this.workflowName = name;
	}
	
	@Override
	public void setObjectId(ObjectId objectId) {

	}

	@Override@Transient
	public ObjectId getObjectId() {
		return null;
	}

	@Override
	public void setLeaf(boolean leaf) {

	}

	@Override@Transient
	public boolean isLeaf() {
		return false;
	}

	@Override
	public void setRoot(DBObject root) {

	}

	@Override@Transient
	public DBObject getRoot() {
		return null;
	}

	@Override
	public void setSort(Integer sort) {

	}

	@Override@Transient
	public Integer getSort() {
		return null;
	}

	public void setId(Long id){
		this.id = id;
	}
	
	@Id@BID 
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return this.id;
	}


	@Override
	@Transient
	public boolean isInitialized() {
		return false;
	}

	public void setState(Integer state) {
		this.state = state;
	}
	
	@Override
	public int getState() {
		
		return  state;
	}

	public void setWorkflowName(String workflowName) {
		this.workflowName = workflowName;
	}

	public String getWorkflowName() {
		return workflowName;
	}	

}
